//
//  YZAttDocInfoBelowView.m
//  kuaiyi
//
//  Created by Liu on 16/5/5.
//
//

#import "YZAttDocInfoBelowView.h"

@interface YZAttDocInfoBelowView ()

/**
 *  接诊条件
 */
@property (weak, nonatomic) IBOutlet UIButton *belowConditionBtn;

/**
 *  医生简介
 */
@property (weak, nonatomic) IBOutlet UIButton *belowDocIntroBtn;
/**
 *  切换的View
 */
@property (weak, nonatomic) IBOutlet UIView *belowDocSectionView;

#pragma mark - 按钮的点击事件
/**
 *  接诊条件按钮被点击
 */
- (IBAction)bleowConditionBtnDidClock;

/**
 *  医生简介按钮被点击
 */
- (IBAction)belowDocIntroBtnDidClock;

@end



@implementation YZAttDocInfoBelowView

+(instancetype)attDocInfobelowView {
    
    YZAttDocInfoBelowView *belowView = [[YZAttDocInfoBelowView alloc]init];
    belowView = [[[NSBundle mainBundle]loadNibNamed:@"YZAttDocInfoBelowView" owner:nil options:nil] lastObject];
    belowView.belowConditionBtn.selected = YES;
    return belowView;
}



/**
 *  接诊条件按钮被点击
 */
- (IBAction)bleowConditionBtnDidClock {
    if (!self.belowConditionBtn.selected) {
        self.belowConditionBtn.selected = self.belowDocIntroBtn.selected;
        self.belowDocIntroBtn.selected = !self.belowDocIntroBtn.selected;
        [UIView animateWithDuration:0.2 animations:^{
            self.belowDocSectionView.frame = CGRectMake(10, 48, 167, 2);
        }];
        //调用回调
        self.belowConditionBlock();
    }

}
/**
 *  医生简介按钮被点击
 */
- (IBAction)belowDocIntroBtnDidClock {
    if (!self.belowDocIntroBtn.selected) {
        self.belowDocIntroBtn.selected = self.belowConditionBtn.selected;
        self.belowConditionBtn.selected = !self.belowConditionBtn.selected;
        [UIView animateWithDuration:0.2 animations:^{
            self.belowDocSectionView.frame = CGRectMake(187, 48, 167, 2);
            //调用回调
            self.belowDocIntroBlock();
        }];
    }

}
@end
